home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / scripts / jobclient.awk < prev    next >
Text File  |  1997-02-04  |  706b  |  41 lines

  1. BEGIN {
  2.     file=ENVIRON["HOME"] "/Mail/jobs"
  3.     IGNORECASE=1
  4.  
  5.     while ((getline < file) > 0)
  6.     {
  7.     # Comment or empty line
  8.     if (match($0,/^#/) || $1=="")
  9.         continue;
  10.  
  11.     for (t=0; t<ARGC; t++)
  12.     {
  13.         # Does this job match any of the ones we look for ?
  14.         if (match ($0,ARGV[t]))
  15.         {
  16.         # Job is not completed yet ?
  17.         if ($2!="DONE")
  18.         {
  19.             # Show description of job
  20.             if (NF > 3)
  21.             {
  22.             printf ("# ");
  23.             for (t=4; t<=NF; t++)
  24.                 printf ("%s ", $t);
  25.             print ""
  26.             }
  27.  
  28.             # Show what can be done with the job
  29.             if ($2=="FREE")
  30.             print "req "$1;
  31.             if ($2=="WORK" || $2=="FREE")
  32.             print "done "$1;
  33.         }
  34.  
  35.         # Don't try to print the job twice
  36.         break;
  37.         }
  38.     }
  39.     }
  40. }
  41.